
<!DOCTYPE html>
<!--

    Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->
<!-- Portions Copyright [2019] [Payara Foundation and/or its affiliates] -->
<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <title>create-http-lb-ref</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="css/style.css" rel="stylesheet">
    <script src="https://use.fontawesome.com/96c4d89611.js"></script>
  </head>
  <body>
<table id="doc-title" cellspacing="0" cellpadding="0">
  <tr>
  <td align="left" valign="top">
  <b>create-http-lb-ref</b><br />
  </td>
  </tr>
</table>
<hr />

<table width="90%" id="top-nav" cellspacing="0" cellpadding="0">
	<colgroup>
		<col width="12%"/>
		<col width="12%"/>
		<col width="*"/>
	</colgroup>
	<tr>
		<td align="left">
		<a href="create-http-lb-config.html">
			<span class="vector-font"><i class="fa fa-arrow-circle-left" aria-hidden="true"></i></span>
			<span style="position:relative;top:-2px;">Previous</span>
		</a>
		</td>

		<td align="left">
		<a href="create-http-listener.html">
			<span class=" vector-font"><i class="fa fa-arrow-circle-right vector-font" aria-hidden="true"></i></span>
			<span style="position:relative;top:-2px;">Next</span>
		</a>
		</td>

		<td align="right">
		<a href="toc.html">
			<span class=" vector-font"><i class="fa fa-list vector-font" aria-hidden="true"></i></span>
			<span style="position:relative;top:-2px;">Contents</span>
		</a>
		</td>
	</tr>
</table>


<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><a id="create-http-lb-ref-1"></a><a id="GSRFM00029"></a><a id="create-http-lb-ref"></a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_create_http_lb_ref">create-http-lb-ref</h2>
<div class="sectionbody">
<div class="paragraph">
<p>adds an existing cluster or server instance to an existing load balancer
configuration or load balancer</p>
</div>
<div id="sthref259" class="paragraph">
<p>Synopsis</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code class="language-oac_no_warn" data-lang="oac_no_warn">asadmin [asadmin-options] create-http-lb-ref [--help]
--config config_name | --lbname load_balancer_name
[--lbpolicy round-robin] [--lbpolicymodule lb_policy_module]
[--healthcheckerurl url] [--healthcheckerinterval 10]
[--healthcheckertimeout 10] [--lbenableallinstances=true]
[--lbenableallapplications=true] [--lbweight instance=weight[:instance=weight]*]
target</code></pre>
</div>
</div>
<div id="sthref260" class="paragraph">
<p>Description</p>
</div>
<div class="paragraph">
<p>Use the <code>create-http-lb-ref</code> subcommand to:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Add an existing cluster or server instance to an existing load
balancer configuration or load balancer. The load balancer forwards the
requests to the clustered and standalone instances it references.</p>
</li>
<li>
<p>Set the load balancing policy to round-robin, weighted round-robin, or
to a user-defined policy.</p>
</li>
<li>
<p>Configure a health checker for the load balancer. Any health checker
settings defined here apply only to the target. If you do not create a
health checker with this subcommand, use <code>create-http-health-checker</code>.</p>
</li>
<li>
<p>Enable all instances in the target cluster for load balancing, or use
<code>enable-http-lb-server</code> to enable them individually.</p>
</li>
<li>
<p>Enable all applications deployed to the target for load balancing, or
use <code>enable-http-lb-application</code> to enable them individually.</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<div class="paragraph">
<p>This subcommand is only applicable to Oracle Payara Server. This
subcommand is not applicable to Payara Server Open Source Edition.</p>
</div>
</td>
</tr>
</table>
</div>
<div id="sthref261" class="paragraph">
<p>Options</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">asadmin-options</dt>
<dd>
<p>Options for the <code>asadmin</code> utility. For information about these
options, see the <a href="asadmin.html#asadmin-1m"><code>asadmin</code>(1M)</a> help page.</p>
</dd>
<dt class="hdlist1"><code>--help</code></dt>
<dt class="hdlist1"><code>-?</code></dt>
<dd>
<p>Displays the help text for the subcommand.</p>
</dd>
<dt class="hdlist1"><code>--config</code></dt>
<dd>
<p>Specifies which load balancer configuration to which to add clusters
and server instances. Specify either a load balancer configuration or
a load balancer. Specifying both results in an error.</p>
</dd>
<dt class="hdlist1"><code>--lbname</code></dt>
<dd>
<p>Specifies the load balancer to which to add clusters and server
instances. Specify either a load balancer configuration or a load
balancer. Specifying both results in an error.</p>
</dd>
<dt class="hdlist1"><code>--lbpolicy</code></dt>
<dd>
<p>The policy the load balancer follows. Valid values are <code>round-robin</code>,
<code>weighted-round-robin</code>, and <code>user-defined</code>. If you choose
user-defined, specify a load balancer policy module with the
<code>lbpolicymodule</code> option. If you choose <code>weighted-round-robin</code> assign
weights to the server instances using the <code>configure-lb-weight</code>
subcommand. The default is <code>round-robin</code>.</p>
</dd>
<dt class="hdlist1"><code>--lbpolicymodule</code></dt>
<dd>
<p>If your load balancer policy is <code>user-defined</code>, use this option to
specify the full path and name of the shared library of your load
balancing policy module. The shared library needs to be in a location
accessible by the web server.</p>
</dd>
<dt class="hdlist1"><code>--healthcheckerurl</code></dt>
<dd>
<p>The URL to ping to determine whether the instance is healthy.</p>
</dd>
<dt class="hdlist1"><code>--healthcheckerinterval</code></dt>
<dd>
<p>The interval in seconds the health checker waits between checks of an
unhealthy instance to see whether it has become healthy. The default
value is 30 seconds. A value of 0 disables the health checker.</p>
</dd>
<dt class="hdlist1"><code>--healthcheckertimeout</code></dt>
<dd>
<p>The interval in seconds the health checker waits to receive a response
from an instance. If the health checker has not received a response in
this interval, the instance is considered unhealthy. The default is
10.</p>
</dd>
<dt class="hdlist1"><code>--lbenableallinstances</code></dt>
<dd>
<p>Enables all instances in the target cluster for load balancing. If the
target is a server instance, enables that instance for load balancing.
The default value is true.</p>
</dd>
<dt class="hdlist1"><code>--lbenableallapplications</code></dt>
<dd>
<p>Enables all applications deployed to the target cluster or instance
for load balancing. The default value is true.</p>
</dd>
<dt class="hdlist1"><code>--lbweight</code></dt>
<dd>
<p>The name of the instance and the weight you are assigning it. The
weight must be an integer. The pairs of instances and weights are
separated by colons. For example <code>instance1=1:instance2=4</code> means that
for every five requests, one goes to instance1 and four go to
instance2. A weight of 1 is the default.</p>
</dd>
</dl>
</div>
<div id="sthref262" class="paragraph">
<p>Operands</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">target</dt>
<dd>
<p>Specifies which cluster or instance to add to the load balancer. Valid
values are:<br></p>
<div class="ulist">
<ul>
<li>
<p>cluster_name- Specifies that requests for this cluster will be
handled by the load balancer.</p>
</li>
<li>
<p>stand-alone_instance_name- Specifies that requests for this
standalone instance will be handled by the load balancer.</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
<div id="sthref263" class="paragraph">
<p>Examples</p>
</div>
<div class="paragraph">
<p><a id="GSRFM480"></a><a id="sthref264"></a></p>
</div>
<div class="paragraph">
<p>Example 1   Adding a Cluster Reference to a Load Balancer Configuration</p>
</div>
<div class="paragraph">
<p>This example adds a reference to a cluster named <code>cluster2</code> to a load
balancer configuration named <code>mylbconfig</code>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code class="language-oac_no_warn" data-lang="oac_no_warn">asadmin&gt; create-http-lb-ref --config mylbconfig cluster2

Command create-http-lb-ref executed successfully.</code></pre>
</div>
</div>
<div class="paragraph">
<p><a id="GSRFM481"></a><a id="sthref265"></a></p>
</div>
<div class="paragraph">
<p>Example 2   Adding a Cluster Reference to a Load Balancer</p>
</div>
<div class="paragraph">
<p>This example adds a reference to a cluster named <code>cluster2</code> to a load
balancer named <code>mylb</code>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code class="language-oac_no_warn" data-lang="oac_no_warn">asadmin&gt; create-http-lb-ref --lbname mylb cluster2

Command create-http-lb-ref executed successfully.</code></pre>
</div>
</div>
<div class="paragraph">
<p><a id="GSRFM482"></a><a id="sthref266"></a></p>
</div>
<div class="paragraph">
<p>Example 3   Configuring a Health Checker and Load Balancer Policy</p>
</div>
<div class="paragraph">
<p>This example configures a health checker and load balancing policy, and
enables the load balancer for instances and applications.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code class="language-oac_no_warn" data-lang="oac_no_warn">asadmin&gt; create-http-lb-ref --config mylbconfig --lbpolicy weighted-round-robin
--healthcheckerinterval 40 --healthcheckertimeout 20
--lbenableallinstances=true --lbenableallapplications=true cluster2

Command create-http-lb-ref executed successfully.</code></pre>
</div>
</div>
<div class="paragraph">
<p><a id="GSRFM483"></a><a id="sthref267"></a></p>
</div>
<div class="paragraph">
<p>Example 4   Setting a User-Defined Load Balancing Policy</p>
</div>
<div class="paragraph">
<p>This example sets a user-defined load balancing policy.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="prettyprint highlight"><code class="language-oac_no_warn" data-lang="oac_no_warn">asadmin&gt; create-http-lb-ref --lbpolicy user-defined --lbpolicymodule /user/modules/module.so
--config mylbconfig cluster2

Command create-http-lb-ref executed successfully.</code></pre>
</div>
</div>
<div id="sthref268" class="paragraph">
<p>Exit Status</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">0</dt>
<dd>
<p>subcommand executed successfully</p>
</dd>
<dt class="hdlist1">1</dt>
<dd>
<p>error in executing the subcommand</p>
</dd>
</dl>
</div>
<div id="sthref269" class="paragraph">
<p>See Also</p>
</div>
<div class="paragraph">
<p><a href="asadmin.html#asadmin-1m"><code>asadmin</code>(1M)</a></p>
</div>
<div class="paragraph">
<p><a href="configure-lb-weight.html#configure-lb-weight-1"><code>configure-lb-weight</code>(1)</a>,
<a href="create-http-health-checker.html#create-http-health-checker-1"><code>create-http-health-checker</code>(1)</a>,
<a href="delete-http-lb-ref.html#delete-http-lb-ref-1"><code>delete-http-lb-ref</code>(1)</a>,
<a href="enable-http-lb-application.html#enable-http-lb-application-1"><code>enable-http-lb-application</code>(1)</a>,
<a href="enable-http-lb-server.html#enable-http-lb-server-1"><code>enable-http-lb-server</code>(1)</a>,
<a href="list-http-lb-configs.html#list-http-lb-configs-1"><code>list-http-lb-configs</code>(1)</a>,
<a href="list-http-lbs.html#list-http-lbs-1"><code>list-http-lbs</code>(1)</a></p>
</div>
</div>
</div>

<hr />

<table width="90%" id="bottom-nav" cellspacing="0" cellpadding="0">
	<colgroup>
		<col width="12%"/>
		<col width="12%"/>
		<col width="*"/>
	</colgroup>
	<tr>		
		<td align="left">
		<a href="create-http-lb-config.html">
			<span class=" vector-font"><i class="fa fa-arrow-circle-left" aria-hidden="true"></i></span>
			<span style="position:relative;top:-2px;">Previous</span>
		</a>
		</td>

		<td align="left">
		<a href="create-http-listener.html">
			<span class="vector-font"><i class="fa fa-arrow-circle-right vector-font" aria-hidden="true"></i></span>
			<span style="position:relative;top:-2px;">Next</span>
		</a>
		</td>

		<td align="right">
		<a href="toc.html">
			<span class="vector-font"><i class="fa fa-list vector-font" aria-hidden="true"></i></span>
			<span style="position:relative;top:-2px;">Contents</span>
		</a>
		</td>
	</tr>
</table>

<span id="copyright">
        <img src="/resource/reference/img/eclipse_foundation_logo_tiny.png" height="20px" alt="Eclipse Foundation Logo" align="top"/>&nbsp;            
        <span >Copyright&nbsp;&copy;&nbsp;2019,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span>
</span>

</body>
</html>
